package view

import (
	"goruntimeDistributionCrawler/frontend/model"
	"html/template"
	"io"
)

type SearchResultView struct {
	templat *template.Template
}

func CreateSearchResultView(
	filename string) SearchResultView {
	return SearchResultView{
		templat:template.Must(
			template.ParseFiles(filename)),
	}
}

func (s SearchResultView) Render(w io.Writer,data model.SearchResult) error{
   return  s.templat.Execute(w,data)
}


